﻿using System;

namespace TrinityEngine
{
    public static class Time
    {
        public static float fixedDeltaTime = 0.02f;

        public static float deltaTime { get; private set; } = 0f;

        public static float timeScale = 1f;

        public static float time { get; private set; } = 0f;

        private static DateTime _beginTime = DateTime.Now;

        private static DateTime _lastFrameTime = DateTime.Now;

        public static void Update()
        {
            deltaTime = (float)(DateTime.Now - _lastFrameTime).TotalSeconds;
            time = (float)(DateTime.Now - _beginTime).TotalSeconds;
            _lastFrameTime = DateTime.Now;
        }
    }
}
